package net.zhuike.novel.app.ui.view;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;

/**
 * Created by wq on 2016/7/5.
 */
public class UeDialog {

    private static ProgressDialog progress;
    private static AlertDialog.Builder alertDialogBuilder;

    public static void showprogressDialog(Context context, String title, String message, boolean cancelable) {
        progress = new ProgressDialog(context);
        progress.setTitle(title);
        progress.setMessage(message);
        progress.setCancelable(true);
        progress.show();
    }

    public static void hideProgress() {
        if (progress != null && progress.isShowing()) {
            progress.dismiss();
        }
    }


    public static void showAlert(Context context,String title,String msg,String positiontext,String nevaText,
                                 DialogInterface.OnClickListener positonClicker,
                                 DialogInterface.OnClickListener nevaClicker) {
        alertDialogBuilder=new AlertDialog.Builder(context);
        alertDialogBuilder.setTitle(title);//设置标题
        alertDialogBuilder.setMessage(msg);//设置显示文本
        alertDialogBuilder.setPositiveButton(positiontext, positonClicker);
        alertDialogBuilder.setNegativeButton(nevaText, nevaClicker);
        alertDialogBuilder.show();

    }

}
